package com.aruba.attendance.home.view

import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.navigation.NavHostController
import com.aruba.attendance.R
import com.aruba.attendance.initial.view.InitialTimeSelect
import com.aruba.attendance.initial.viewmodel.InitialViewModel

/**
 * 导航-设置-上下班时间重新选择
 */
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun NavSettingTime(
    navController: NavHostController,
    initialViewModel: InitialViewModel,
) {
    TopAppBar(
        title = { },
        navigationIcon = {
            IconButton(onClick = {
                navController.popBackStack()
            }) {
                Icon(
                    Icons.Default.ArrowBack,
                    contentDescription = "back"
                )
            }
        }
    )

    InitialTimeSelect(navController = navController, initialViewModel = initialViewModel) {
        Text(
            text = stringResource(R.string.hint_reset_time),
            textAlign = TextAlign.Center,
            modifier = Modifier.padding(top = 10.dp),
            style = MaterialTheme.typography.bodySmall
        )
    }
}